<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg">

<script type="text/javascript">
function create_a(evt)
{
var SVGDoc=document;
var txt=SVGDoc.getElementById("txt");
var link=SVGDoc.createElement("a");
var text_node=SVGDoc.createTextNode("LINK");

link.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","http://www.w3schools.com");

link.appendChild(text_node);
txt.appendChild(link);
}
</script>

<text id="txt" x="10" y="10">Click on the circle to create a ....</text>
<circle cx="20" cy="40" r="1.5em" style="fill:blue" onclick="create_a(evt)" />

</svg>